import 'package:flutter/material.dart';



class NavtiongateDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
        FlatButton(
          child: Text('Home'),
          onPressed:(){
           Navigator.pushNamed(context, '/Home');
          }
        ),
         FlatButton( 
          child: Text('About'),
          onPressed:(){
            Navigator.of(context).push(
              MaterialPageRoute(builder: (BuildContext context)=>NavtiongateDemoPage(title: 'About',))
            );
          }
         ),
          ],
        ),
      ),

    );
  }
}

class NavtiongateDemoPage extends StatelessWidget {
final String title;
  NavtiongateDemoPage({
     this.title
  });
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title:Text(title),
        elevation:0.0
      ),
      floatingActionButton: FloatingActionButton(
        child: Icon(Icons.arrow_back),
        onPressed:(){
          Navigator.pop(context);
      }),
    );
  }
}